var t = require("../../../@babel/runtime/helpers/objectWithoutProperties"), e = [ "url" ], a = getApp();

Component({
    properties: {
        datas: {
            value: {
                preview_color: {
                    color: "transparent",
                    isColor: 1
                }
            },
            type: null
        },
        component_id: {
            type: null
        }
    },
    data: {
        level_list: [],
        info: {},
        optionName: {}
    },
    lifetimes: {
        attached: function() {
            this.getData();
            try {
                var t = wx.getStorageSync("yz_basic_info"), e = t.point, a = t.balance, o = t.love, i = t.integral;
                this.data.optionName.point = e, this.data.optionName.balance = a, this.data.optionName.love = o, 
                this.data.optionName.integral = i, this.setData({
                    optionName: this.data.optionName
                });
            } catch (t) {}
        },
        detached: function() {}
    },
    methods: {
        getData: function() {
            var t = this, e = a.getNetAddresss("plugin.ys-system.frontend.member-info.index");
            a._postNetWork({
                url: e,
                data: {},
                success: function(e) {
                    var a = e.data;
                    1 == a.result ? t.setData({
                        level_list: a.data.level_list,
                        info: a.data
                    }) : wx.showToast({
                        icon: "none",
                        title: a.msg,
                        duration: 1e3
                    });
                },
                fail: function(t) {
                    console.log(t);
                }
            });
        },
        toUrl: function(t) {
            var e = t.currentTarget.dataset || {};
            this.wxRouterLink(e);
        },
        wxRouterLink: function(a) {
            var o = "", i = a.url, n = t(a, e);
            0 != Object.keys(n).length ? (Object.keys(n).forEach(function(t) {
                "" !== n[t] && (o += t + "=" + n[t] + "&");
            }), "" !== i && wx.navigateTo({
                url: i + "?" + o.slice(0, -1)
            })) : wx.navigateTo({
                url: i
            });
        }
    }
});